Skip to content

test(app): run launcher matrix tests in parallel - #356

Merged
umputun merged 1 commit into
masterfrom
parallel-launcher-tests
Sep 9, 2026
Merged

test(app): run launcher matrix tests in parallel#356
umputun merged 1 commit into
masterfrom
parallel-launcher-tests

Conversation

@umputun

@umputun umputun commented Sep 9, 2026

Copy link
Copy Markdown
Owner

the three launcher tests ran strictly serially and took 121s of the app package's 139s, leaving about 26s of headroom under the 180s race budget. That budget already shaped test design: the stderr expectations were folded into an existing matrix instead of getting their own pass, to avoid crossing it.

the 139 leaf subtests are independent. Each gets its own TMPDIR, passes an explicit environment to its subprocess through mergeEnv, and runs its launcher in its own process group via Setpgid. Marking them parallel is safe on all three counts.

result on a 20-core mac

before after
app package, race 139-154s 62-72s
headroom under the 180s budget ~26s ~110s

the win comes from saturating idle cores rather than overlapping idle waits. Individual subtests get slower under contention, so the work is process-spawn bound, not sleep bound.

two details worth recording:

  • t.Parallel() has to precede the windows skip guard, or tparallel still reports the parent as serial.
  • a parallel parent is safe next to the t.Setenv tests in config_test.go and termbg_test.go. Go pauses every parallel test until all serial ones finish, so they never overlap and no env var can leak into a launcher subprocess.

verification: 8 consecutive green runs of the three tests, golangci-lint clean, and the full suite passing at the real -timeout=180s.

The three launcher tests accounted for 121s of the app package's 139s, run
strictly serially, leaving about 26s of headroom under the 180s race budget
on macOS. That budget already constrained test design: the stderr expectations
were folded into an existing matrix rather than given their own pass to avoid
crossing it.

The subtests are independent - each gets its own TMPDIR, passes an explicit
environment to its subprocess, and runs its launcher in its own process group -
so marking them parallel is safe. The package drops to about 65s.

t.Parallel() precedes the windows skip guard because tparallel otherwise
reports the parent as serial.
Copilot AI lite review requested due to automatic review settings September 9, 2026 18:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is limited to test parallelization, and the test harness isolates per-subtest temp/state via per-test TMPDIR + explicit subprocess env, avoiding shared-process mutations.

Pull request overview

This PR reduces CI/runtime for the app package launcher-matrix tests by running independent subtests in parallel, improving headroom under the race-test timeout budget.

Changes:

  • Mark TestShellLaunchersPreserveAnnotationExitCode, TestHerdrSignalPaneOwnership, and TestHerdrPaneOverlayOptIn as parallel.
  • Mark the launcher-matrix subtests (t.Run(...)) inside those tests as parallel to enable concurrent execution across launcher/backends/cases.
File summaries
File Description
app/plugin_exit_code_test.go Adds t.Parallel() to the three launcher matrix tests and their subtests to run the matrix concurrently and cut wall-clock time.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@umputun
umputun merged commit 2379ebd into master Sep 9, 2026
6 checks passed
@umputun
umputun deleted the parallel-launcher-tests branch September 9, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants